﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.Repository
{
    /// <summary>
    /// 日志存储器工厂接口
    /// </summary>
    /// <remarks></remarks>
    /// <history>
    /// [zanezeng]               2009/10/13 15:35    创建
    /// </history>
    public interface IRepositoryFactory : IDisposable
    {
        #region ---Property

        /// <summary>
        /// 获得一个值，该值用于判断当前日志存储器工厂是否已经关闭
        /// </summary>
        /// <value>
        /// 	如果当前日志存储器工厂已经被关闭，则返回<c>true</c>，否则返回<c>false</c>。
        /// </value>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/6 11:27    创建
        /// </history>
        bool IsClosed
        {
            get;
        }

        #endregion

        #region ---Method

        /// <summary>
        /// 创建日志存储器
        /// </summary>
        /// <returns>创建的日志存储器</returns>
        /// <remarks></remarks>
        /// <exception cref="ObjectDisposedException">当前日志存储器已经被关闭</exception>
        /// <history>
        /// [zanezeng]               2009/10/13 15:39    创建
        /// </history>
        ILoggingRepository GetRepository();

        /// <summary>
        /// 根据给定的配置信息创建日志存储器
        /// </summary>
        /// <param name="configuration">用于创建日志存储器的配置信息</param>
        /// <returns>创建的日志存储器</returns>
        /// <remarks></remarks>
        /// <exception cref="ObjectDisposedException">当前日志存储器已经被关闭</exception>
        /// <history>
        /// [zanezeng]               2009/10/14 10:43    创建
        /// </history>
        ILoggingRepository GetRepository( object configuration );

        /// <summary>
        /// 关闭当前日志存储器工厂
        /// </summary>
        /// <remarks></remarks>
        /// <history>
        /// [zanezeng]               2010/1/6 11:29    创建
        /// </history>
        void Close();

        #endregion
    }
}
